import smtplib
from email.mime.text import MIMEText
from map_backend.settings import EMAIL_FROM,EMAIL_HOST,EMAIL_PORT,EMAIL_HOST_USER,EMAIL_HOST_PASSWORD


def send_email(email_account,subject,content):
    msg=MIMEText(content,'plain','utf-8')
    msg['Form']=EMAIL_FROM
    msg['To']=email_account
    msg['Subject']=subject
    server=smtplib.SMTP_SSL(EMAIL_HOST)
    server.connect(EMAIL_HOST, EMAIL_PORT)
    server.login(EMAIL_HOST_USER,EMAIL_HOST_PASSWORD)
    server.sendmail(EMAIL_FROM,[email_account,],msg=msg.as_string())
    server.quit()